package onpenfeign.com.kc.controller;

import common.common.Util.ResponseBean;
import onpenfeign.com.kc.service.CommonFeign;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class RegistAndLogin {

    @Resource
    private CommonFeign commonFeign;

    @GetMapping("/stars/getphonecode")
    public void getphonecode(String phone){
        commonFeign.GetPhoneCode(phone);
    }

    @PostMapping("stars/phonelogin")
    public ResponseBean phonelogin(String phone,String password){
        return commonFeign.Login(phone,password);
    }

    @PostMapping("stars/regist")
    public ResponseBean regist(@RequestBody String json){
        return commonFeign.register(json);
    }

    @PostMapping("stars/jobnumberlogin")
    public ResponseBean jobnumberlogin(String jobnumber,String password){
        return commonFeign.jobNumberLogin(jobnumber, password);
    }

}
